\(\int \cos (c+d x) (a+b \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx\) [297]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 29, antiderivative size = 119 \[ \int \cos (c+d x) (a+b \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=a^2 (3 A b+a B) x+\frac {b \left (6 a A b+6 a^2 B+b^2 B\right ) \text {arctanh}(\sin (c+d x))}{2 d}+\frac {a^2 (2 a A-b B) \sin (c+d x)}{2 d}+\frac {b B (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}+\frac {b^2 (A b+2 a B) \tan (c+d x)}{d} \]

[Out]

a^2*(3*A*b+B*a)*x+1/2*b*(6*A*a*b+6*B*a^2+B*b^2)*arctanh(sin(d*x+c))/d+1/2*a^2*(2*A*a-B*b)*sin(d*x+c)/d+1/2*b*B
*(a+b*sec(d*x+c))^2*sin(d*x+c)/d+b^2*(A*b+2*B*a)*tan(d*x+c)/d

Rubi [A] (verified)

Time = 0.25 (sec) , antiderivative size = 131, normalized size of antiderivative = 1.10, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {4110, 4133, 3855, 3852, 8} \[ \int \cos (c+d x) (a+b \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {b \left (6 a^2 B+6 a A b+b^2 B\right ) \text {arctanh}(\sin (c+d x))}{2 d}-\frac {b \left (2 a^2 A-3 a b B-A b^2\right ) \tan (c+d x)}{d}+a^2 x (a B+3 A b)-\frac {b^2 (2 a A-b B) \tan (c+d x) \sec (c+d x)}{2 d}+\frac {a A \sin (c+d x) (a+b \sec (c+d x))^2}{d} \]

[In]

Int[Cos[c + d*x]*(a + b*Sec[c + d*x])^3*(A + B*Sec[c + d*x]),x]

[Out]

a^2*(3*A*b + a*B)*x + (b*(6*a*A*b + 6*a^2*B + b^2*B)*ArcTanh[Sin[c + d*x]])/(2*d) + (a*A*(a + b*Sec[c + d*x])^
2*Sin[c + d*x])/d - (b*(2*a^2*A - A*b^2 - 3*a*b*B)*Tan[c + d*x])/d - (b^2*(2*a*A - b*B)*Sec[c + d*x]*Tan[c + d
*x])/(2*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4110

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*
(B_.) + (A_)), x_Symbol] :> Simp[a*A*Cot[e + f*x]*(a + b*Csc[e + f*x])^(m - 1)*((d*Csc[e + f*x])^n/(f*n)), x]
+ Dist[1/(d*n), Int[(a + b*Csc[e + f*x])^(m - 2)*(d*Csc[e + f*x])^(n + 1)*Simp[a*(a*B*n - A*b*(m - n - 1)) + (
2*a*b*B*n + A*(b^2*n + a^2*(1 + n)))*Csc[e + f*x] + b*(b*B*n + a*A*(m + n))*Csc[e + f*x]^2, x], x], x] /; Free
Q[{a, b, d, e, f, A, B}, x] && NeQ[A*b - a*B, 0] && NeQ[a^2 - b^2, 0] && GtQ[m, 1] && LeQ[n, -1]

Rule 4133

Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*(csc[(e_.) + (f_.)*(x_)]*(b_.) +
 (a_)), x_Symbol] :> Simp[(-b)*C*Csc[e + f*x]*(Cot[e + f*x]/(2*f)), x] + Dist[1/2, Int[Simp[2*A*a + (2*B*a + b
*(2*A + C))*Csc[e + f*x] + 2*(a*C + B*b)*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a, b, e, f, A, B, C}, x]

Rubi steps \begin{align*} \text {integral}& = \frac {a A (a+b \sec (c+d x))^2 \sin (c+d x)}{d}-\int (a+b \sec (c+d x)) \left (-a (3 A b+a B)-b (A b+2 a B) \sec (c+d x)+b (2 a A-b B) \sec ^2(c+d x)\right ) \, dx \\ & = \frac {a A (a+b \sec (c+d x))^2 \sin (c+d x)}{d}-\frac {b^2 (2 a A-b B) \sec (c+d x) \tan (c+d x)}{2 d}-\frac {1}{2} \int \left (-2 a^2 (3 A b+a B)-b \left (6 a A b+6 a^2 B+b^2 B\right ) \sec (c+d x)+2 b \left (2 a^2 A-A b^2-3 a b B\right ) \sec ^2(c+d x)\right ) \, dx \\ & = a^2 (3 A b+a B) x+\frac {a A (a+b \sec (c+d x))^2 \sin (c+d x)}{d}-\frac {b^2 (2 a A-b B) \sec (c+d x) \tan (c+d x)}{2 d}-\left (b \left (2 a^2 A-A b^2-3 a b B\right )\right ) \int \sec ^2(c+d x) \, dx+\frac {1}{2} \left (b \left (6 a A b+6 a^2 B+b^2 B\right )\right ) \int \sec (c+d x) \, dx \\ & = a^2 (3 A b+a B) x+\frac {b \left (6 a A b+6 a^2 B+b^2 B\right ) \text {arctanh}(\sin (c+d x))}{2 d}+\frac {a A (a+b \sec (c+d x))^2 \sin (c+d x)}{d}-\frac {b^2 (2 a A-b B) \sec (c+d x) \tan (c+d x)}{2 d}+\frac {\left (b \left (2 a^2 A-A b^2-3 a b B\right )\right ) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{d} \\ & = a^2 (3 A b+a B) x+\frac {b \left (6 a A b+6 a^2 B+b^2 B\right ) \text {arctanh}(\sin (c+d x))}{2 d}+\frac {a A (a+b \sec (c+d x))^2 \sin (c+d x)}{d}-\frac {b \left (2 a^2 A-A b^2-3 a b B\right ) \tan (c+d x)}{d}-\frac {b^2 (2 a A-b B) \sec (c+d x) \tan (c+d x)}{2 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.92 (sec) , antiderivative size = 105, normalized size of antiderivative = 0.88 \[ \int \cos (c+d x) (a+b \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {6 a^2 A b d x+2 a^3 B d x+b \left (6 a A b+6 a^2 B+b^2 B\right ) \text {arctanh}(\sin (c+d x))+2 a^3 A \sin (c+d x)+2 A b^3 \tan (c+d x)+6 a b^2 B \tan (c+d x)+b^3 B \sec (c+d x) \tan (c+d x)}{2 d} \]

[In]

Integrate[Cos[c + d*x]*(a + b*Sec[c + d*x])^3*(A + B*Sec[c + d*x]),x]

[Out]

(6*a^2*A*b*d*x + 2*a^3*B*d*x + b*(6*a*A*b + 6*a^2*B + b^2*B)*ArcTanh[Sin[c + d*x]] + 2*a^3*A*Sin[c + d*x] + 2*
A*b^3*Tan[c + d*x] + 6*a*b^2*B*Tan[c + d*x] + b^3*B*Sec[c + d*x]*Tan[c + d*x])/(2*d)

Maple [A] (verified)

Time = 2.87 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.18

method result size
derivativedivides \(\frac {A \,a^{3} \sin \left (d x +c \right )+B \,a^{3} \left (d x +c \right )+3 A \,a^{2} b \left (d x +c \right )+3 B \,a^{2} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 A a \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 B \tan \left (d x +c \right ) a \,b^{2}+A \tan \left (d x +c \right ) b^{3}+B \,b^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) \(141\)
default \(\frac {A \,a^{3} \sin \left (d x +c \right )+B \,a^{3} \left (d x +c \right )+3 A \,a^{2} b \left (d x +c \right )+3 B \,a^{2} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 A a \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 B \tan \left (d x +c \right ) a \,b^{2}+A \tan \left (d x +c \right ) b^{3}+B \,b^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) \(141\)
parallelrisch \(\frac {-6 b \left (1+\cos \left (2 d x +2 c \right )\right ) \left (A a b +B \,a^{2}+\frac {1}{6} b^{2} B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+6 b \left (1+\cos \left (2 d x +2 c \right )\right ) \left (A a b +B \,a^{2}+\frac {1}{6} b^{2} B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+6 \left (A b +\frac {B a}{3}\right ) d x \,a^{2} \cos \left (2 d x +2 c \right )+\left (2 A \,b^{3}+6 B a \,b^{2}\right ) \sin \left (2 d x +2 c \right )+a^{3} A \sin \left (3 d x +3 c \right )+\left (a^{3} A +2 B \,b^{3}\right ) \sin \left (d x +c \right )+6 \left (A b +\frac {B a}{3}\right ) d x \,a^{2}}{2 d \left (1+\cos \left (2 d x +2 c \right )\right )}\) \(200\)
risch \(3 A \,a^{2} b x +a^{3} x B -\frac {i a^{3} A \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i a^{3} A \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}-\frac {i b^{2} \left (B b \,{\mathrm e}^{3 i \left (d x +c \right )}-2 A b \,{\mathrm e}^{2 i \left (d x +c \right )}-6 B a \,{\mathrm e}^{2 i \left (d x +c \right )}-B b \,{\mathrm e}^{i \left (d x +c \right )}-2 A b -6 B a \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A a \,b^{2}}{d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B \,a^{2} b}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B \,b^{3}}{2 d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A a \,b^{2}}{d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B \,a^{2} b}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B \,b^{3}}{2 d}\) \(272\)
norman \(\frac {\left (-3 A \,a^{2} b -B \,a^{3}\right ) x +\left (-6 A \,a^{2} b -2 B \,a^{3}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (3 A \,a^{2} b +B \,a^{3}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (6 A \,a^{2} b +2 B \,a^{3}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\frac {\left (2 a^{3} A -2 A \,b^{3}-6 B a \,b^{2}+B \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}+\frac {\left (6 a^{3} A +2 A \,b^{3}+6 B a \,b^{2}-B \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}-\frac {\left (2 a^{3} A +2 A \,b^{3}+6 B a \,b^{2}+B \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {\left (6 a^{3} A -2 A \,b^{3}-6 B a \,b^{2}-B \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right ) \left (-1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}-\frac {b \left (6 A a b +6 B \,a^{2}+b^{2} B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {b \left (6 A a b +6 B \,a^{2}+b^{2} B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) \(362\)

[In]

int(cos(d*x+c)*(a+b*sec(d*x+c))^3*(A+B*sec(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(A*a^3*sin(d*x+c)+B*a^3*(d*x+c)+3*A*a^2*b*(d*x+c)+3*B*a^2*b*ln(sec(d*x+c)+tan(d*x+c))+3*A*a*b^2*ln(sec(d*x
+c)+tan(d*x+c))+3*B*tan(d*x+c)*a*b^2+A*tan(d*x+c)*b^3+B*b^3*(1/2*sec(d*x+c)*tan(d*x+c)+1/2*ln(sec(d*x+c)+tan(d
*x+c))))

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 167, normalized size of antiderivative = 1.40 \[ \int \cos (c+d x) (a+b \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {4 \, {\left (B a^{3} + 3 \, A a^{2} b\right )} d x \cos \left (d x + c\right )^{2} + {\left (6 \, B a^{2} b + 6 \, A a b^{2} + B b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (6 \, B a^{2} b + 6 \, A a b^{2} + B b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, A a^{3} \cos \left (d x + c\right )^{2} + B b^{3} + 2 \, {\left (3 \, B a b^{2} + A b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \]

[In]

integrate(cos(d*x+c)*(a+b*sec(d*x+c))^3*(A+B*sec(d*x+c)),x, algorithm="fricas")

[Out]

1/4*(4*(B*a^3 + 3*A*a^2*b)*d*x*cos(d*x + c)^2 + (6*B*a^2*b + 6*A*a*b^2 + B*b^3)*cos(d*x + c)^2*log(sin(d*x + c
) + 1) - (6*B*a^2*b + 6*A*a*b^2 + B*b^3)*cos(d*x + c)^2*log(-sin(d*x + c) + 1) + 2*(2*A*a^3*cos(d*x + c)^2 + B
*b^3 + 2*(3*B*a*b^2 + A*b^3)*cos(d*x + c))*sin(d*x + c))/(d*cos(d*x + c)^2)

Sympy [F]

\[ \int \cos (c+d x) (a+b \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\int \left (A + B \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right )^{3} \cos {\left (c + d x \right )}\, dx \]

[In]

integrate(cos(d*x+c)*(a+b*sec(d*x+c))**3*(A+B*sec(d*x+c)),x)

[Out]

Integral((A + B*sec(c + d*x))*(a + b*sec(c + d*x))**3*cos(c + d*x), x)

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 169, normalized size of antiderivative = 1.42 \[ \int \cos (c+d x) (a+b \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {4 \, {\left (d x + c\right )} B a^{3} + 12 \, {\left (d x + c\right )} A a^{2} b - B b^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, B a^{2} b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, A a b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 4 \, A a^{3} \sin \left (d x + c\right ) + 12 \, B a b^{2} \tan \left (d x + c\right ) + 4 \, A b^{3} \tan \left (d x + c\right )}{4 \, d} \]

[In]

integrate(cos(d*x+c)*(a+b*sec(d*x+c))^3*(A+B*sec(d*x+c)),x, algorithm="maxima")

[Out]

1/4*(4*(d*x + c)*B*a^3 + 12*(d*x + c)*A*a^2*b - B*b^3*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x + c)
+ 1) + log(sin(d*x + c) - 1)) + 6*B*a^2*b*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 6*A*a*b^2*(log(sin
(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 4*A*a^3*sin(d*x + c) + 12*B*a*b^2*tan(d*x + c) + 4*A*b^3*tan(d*x + c
))/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 241 vs. \(2 (113) = 226\).

Time = 0.35 (sec) , antiderivative size = 241, normalized size of antiderivative = 2.03 \[ \int \cos (c+d x) (a+b \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {\frac {4 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1} + 2 \, {\left (B a^{3} + 3 \, A a^{2} b\right )} {\left (d x + c\right )} + {\left (6 \, B a^{2} b + 6 \, A a b^{2} + B b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (6 \, B a^{2} b + 6 \, A a b^{2} + B b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (6 \, B a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, A b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - B b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6 \, B a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, A b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - B b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \]

[In]

integrate(cos(d*x+c)*(a+b*sec(d*x+c))^3*(A+B*sec(d*x+c)),x, algorithm="giac")

[Out]

1/2*(4*A*a^3*tan(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2*c)^2 + 1) + 2*(B*a^3 + 3*A*a^2*b)*(d*x + c) + (6*B*a^2*b
+ 6*A*a*b^2 + B*b^3)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - (6*B*a^2*b + 6*A*a*b^2 + B*b^3)*log(abs(tan(1/2*d*x
+ 1/2*c) - 1)) - 2*(6*B*a*b^2*tan(1/2*d*x + 1/2*c)^3 + 2*A*b^3*tan(1/2*d*x + 1/2*c)^3 - B*b^3*tan(1/2*d*x + 1/
2*c)^3 - 6*B*a*b^2*tan(1/2*d*x + 1/2*c) - 2*A*b^3*tan(1/2*d*x + 1/2*c) - B*b^3*tan(1/2*d*x + 1/2*c))/(tan(1/2*
d*x + 1/2*c)^2 - 1)^2)/d

Mupad [B] (verification not implemented)

Time = 15.64 (sec) , antiderivative size = 249, normalized size of antiderivative = 2.09 \[ \int \cos (c+d x) (a+b \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {\frac {A\,a^3\,\sin \left (3\,c+3\,d\,x\right )}{4}+\frac {A\,b^3\,\sin \left (2\,c+2\,d\,x\right )}{2}+\frac {A\,a^3\,\sin \left (c+d\,x\right )}{4}+\frac {B\,b^3\,\sin \left (c+d\,x\right )}{2}+\frac {3\,B\,a\,b^2\,\sin \left (2\,c+2\,d\,x\right )}{2}}{d\,\left (\frac {\cos \left (2\,c+2\,d\,x\right )}{2}+\frac {1}{2}\right )}-\frac {2\,\left (-B\,a^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+\frac {B\,b^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,1{}\mathrm {i}}{2}-3\,A\,a^2\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+A\,a\,b^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,3{}\mathrm {i}+B\,a^2\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,3{}\mathrm {i}\right )}{d} \]

[In]

int(cos(c + d*x)*(A + B/cos(c + d*x))*(a + b/cos(c + d*x))^3,x)

[Out]

((A*a^3*sin(3*c + 3*d*x))/4 + (A*b^3*sin(2*c + 2*d*x))/2 + (A*a^3*sin(c + d*x))/4 + (B*b^3*sin(c + d*x))/2 + (
3*B*a*b^2*sin(2*c + 2*d*x))/2)/(d*(cos(2*c + 2*d*x)/2 + 1/2)) - (2*((B*b^3*atan((sin(c/2 + (d*x)/2)*1i)/cos(c/
2 + (d*x)/2))*1i)/2 - B*a^3*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)) - 3*A*a^2*b*atan(sin(c/2 + (d*x)/2)/co
s(c/2 + (d*x)/2)) + A*a*b^2*atan((sin(c/2 + (d*x)/2)*1i)/cos(c/2 + (d*x)/2))*3i + B*a^2*b*atan((sin(c/2 + (d*x
)/2)*1i)/cos(c/2 + (d*x)/2))*3i))/d